
import urllib2

class Spider(object):
    page = 1

    url = 'http://www.qiushibaike.com/hot/page/' + str(page)
    user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
    headers = {'User-Agent': user_agent}
    try:
        req = urllib2.Request(url, headers=headers)
        response = urllib2.urlopen(req)
        print page
        html = response.read().decode('utf-8')
        print html
    except  Exception, e:
        print e

